package cn.liutao.common.enums;

import lombok.Getter;

/**
 * @author liutao
 * @Description 报表枚举
 * @date 2023/11/5
 */
@Getter
public enum BillEnum {
    BILL_ORDER_BY_DAY(1,"按日计算"),
    BILL_ORDER_BY_MONTH(2,"按月计算"),
    BILL_ORDER_BY_YEAR(3,"按年计算"),
    BILL_ORDER_BY_WEEK(4,"按周计算"),
    BILL_ORDER_BY_ALL(0,"汇总计算")
    ;

    private final Integer intValue;
    private final String desc;

    BillEnum(Integer value, String desc) {
        this.intValue = value;
        this.desc = desc;
    }

    public static BillEnum getByValue(int intValue){
        for (BillEnum constants : values()) {
            if (constants.getIntValue() == intValue) {
                return constants;
            }
        }
        return BILL_ORDER_BY_ALL;
    }

}
